package com.cos.web.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.security.RolesAllowed;

/**
 * @author: COS
 * @time: 2021/11/22 10:14
 * @description:
 */
@Controller
@RequestMapping("/test")
//@Secured(value = "ROLE_ADMIN")
public class TestController {
    //    @Secured(value = "ROLE_USER")
//    @RolesAllowed(value = "ROLE_USER")
    @RequestMapping("/t1")
    public String t1() {
        System.out.println("t1");
        return "index";
    }

    //    @Secured(value = "ROLE_ADMIN")
//@RolesAllowed(value = "ROLE_ADMIN")
    @RequestMapping("/t2")
    public String t2() {
        System.out.println("t2");
        return "index";
    }

    //    @Secured(value = {"ROLE_ADMIN","ROLE_USER"})
//@RolesAllowed(value = {"ROLE_ADMIN","ROLE_USER"})
    @RequestMapping("/t3")
    public String t3() {
        System.out.println("t2");
        return "index";
    }


}
